package com.atguigu.springcloud.大批量任务处理.controller;

import com.atguigu.springcloud.大批量任务处理.service.CouponService;
import jakarta.annotation.Resource;
import lombok.Getter;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author XiongJianLin
 * @date Created in 2025/2/10 15:10
 */
// http://localhost:8001/coupon/sendV1
@RestController("/coupon/")
public class CouponController {
    @Resource
    private CouponService couponService;

    @GetMapping("sendV2")
    public String sendCouponV2(int couponNum)
    {
        couponService.batchTaskV2(50);
        return "ok";
    }


    @GetMapping("sendV1")
    public String sendCouponV1(int couponNum)
    {
        couponService.batchTask(50);
        return "ok";
    }

}
